<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/4/16
 * Time: 10:02
 */
namespace App\Demo\Controllers;
use App\Demo\Models;

class ArticleController extends BaseController
{
	public function articleList()
	{
		/**
		if ($this->isCached()){
			echo 'Is Cached!';
		}else{
			echo 'Is not Cached!';
		}
**/
		$articles = Models\Article::all();
		$this->assign('articles',$articles);
		$this->assign('title','数据库读取操作测试');
		$this->display();




		// add data to database
		$articles = new Models\Article();
		$articles->title = 'title test add';
		$articles->content = 'content test add';
		$articles->save();

	}
}